<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>

<body>

  <div id="app">
    <cpn v-bind:cmovies='movies' :cmessage="message"></cpn>
  </div>

  <template id="cpn">
    <div>
      <ul>
        <li v-for="item in cmovies">{{item}}</li>
        <li>{{cmessage}}</li>
      </ul>
    </div>
  </template>

  <script src="../js/vue.js"></script>
  <script>
    // 父传子 props
    const cpn = {
      template: '#cpn',
      // props:['cmovies', 'cmessage'],
      props: {
        cmovies: {
          type: Array,
          required: true
        },
        cmessage: {
          type: String,
          default: 'aaaaa'
        }
      },
      data() {
        return {

        }
      },
      methods: {

      }
    }

    const app = new Vue({
      el: '#app',
      data: {
        message: 'Hello',
        movies: ['HW', 'HZW', 'HEXD', 'DD']
      },
      components: {
        cpn
      }
    })

  </script>
</body>

</html>